local M = require "packages/mamashengde/record/Made"

local guanghui = fk.CreateSkill {
  name = "shine__guanghui",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable {
  ["shine__guanghui"] = "光辉",
  [":shine__guanghui"] = "锁定技，所有进入变身状态的角色使用牌不能被非变身状态的角色响应；称号与你相同的角色造成伤害时，你获得1点魔力。",
}

guanghui:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(guanghui.name) and target and M.isHenshin(target)
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = data.disresponsiveList or {}
    for _, p in ipairs(player.room.alive_players) do
      if not M.isHenshin(p) then
        table.insertIfNeed(data.disresponsiveList, p)
      end
    end
  end,
})

guanghui:addEffect(fk.DamageCaused, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(guanghui.name) and target and M.getHonor(target) == M.getHonor(player)
  end,
  on_use = function (self, event, target, player, data)
    M.changeMaryoku(player, 1, guanghui.name)
  end,
})

return guanghui